<div class="dux-tools">
  <div class="bread-head">栏目管理 <span class="small">管理网站全部栏目</span> </div>
  <br>
  <div class="tools-function clearfix">
    <div class="float-left"> <a class="button button-small bg-main icon-list" href="__URL__"> 栏目列表</a> </div>
    <?php if(model('user_group')->model_power('category','add')){ ?>
    <div class="button-group float-right"> <a class="button button-small bg-dot icon-plus dropdown-toggle"> 添加 <span class="downward"></span></a>
      <ul class="drop-menu pull-right">
        <li><a href="__APP__/product_category/add">添加产品栏目</a></li>
      	<!--foreach:{$model_list $vo}-->
        <li><a href="__APP__/{$vo.model}_category/add">添加{$vo.name}栏目</a></li>
        <!--{/foreach}-->
      </ul>
    </div>
    <?php } ?>
  </div>
</div>
<div class="admin-main">
    <div class="panel dux-box">
      <div class="table-responsive">
        <table id="table" class="table table-hover ">
          <tbody>
            <tr>
              <th width="80">编号</th>
              <th width="*">栏目名称</th>
              <th width="100">排序</th>
              <th width="*">栏目显示</th>
              <th width="*">栏目属性</th>
              <th width="*">栏目类型</th>
              <th width="200">操作</th>
            </tr>
              <!--foreach:{$list $vo}-->
              <tr>
                <td>{$vo.cid}</td>
                <td><a href="<?php echo ROOTAPP ?>/label/admin_curl/cid-{$vo['cid']}.html" target="_blank">{$vo.cname}</a>
                <!--if:{$vo['image']<>''}-->
                <a href="javascript:;" rel="{$vo.image}" class="class_pic"><img align="AbsMiddle" src="__PUBLICURL__/images/ico/pic.png" width="14" height="14" alt="" /></a>
                <!--{/if}-->
                </td>
                <td>
                <?php if(model('user_group')->model_power('category','edit')){ ?>
                <input type="text" value="{$vo.sequence}" class="input" style="width:50px;" onblur="sequence({$vo['cid']},$(this).val())" />
                <?php }else{ ?>
                {$vo.sequence}
                <?php } ?>
                </td>
                <td>
                <!--if:{$vo['show']==1}-->
                <font color=green><b>√</b></font>
                <!--{else}-->
                <font color=red><b>×</b></font>
                <!--{/if}-->
                </td>
                <td>
                <!--if:{$vo['type']==0}-->
                频道
                <!--{else}-->
                列表
                <!--{/if}-->
                </td>
                <td>
                	<!--if:{$vo['expand']==1}-->产品<!--{else}-->{$vo.mname}<!--{/if}-->
                </td>
                <td>
                <div class="button-group"> <a class="button button-small bg-dot icon-plus dropdown-toggle"> 添加下级 <span class="downward"></span></a>
                  <ul class="drop-menu pull-right">
                    <li><a href="__APP__/product_category/add/id-{$vo.cid}">添加产品栏目</a></li>
                    <!--foreach:{$model_list $v}-->
                    <li><a href="__APP__/{$v.model}_category/add/id-{$vo.cid}">添加{$v.name}栏目</a></li>
                    <!--{/foreach}-->
                  </ul>
                </div>
                <?php if($edit_power){ ?>
                <a class="button bg-blue button-small icon-pencil" href="__APP__/{$vo.admin_category}/edit/id-{$vo.cid}" title="修改"></a>
                <?php } ?>
                <?php if($del_power){ ?>
                <a class="button bg-red button-small icon-trash-o js-del"  href="javascript:void(0);" onclick="del('__APP__/{$vo.admin_category}/del','{$vo.cid}',this)" title="删除"></a>
                <?php } ?>

                 </td>
              </tr>
              <!--{/foreach}-->
          </tbody>
        </table>
      </div>
    </div>
</div>
<script>
//栏目形象图
$(".class_pic").powerFloat({
    targetMode: "ajax"
});
//栏目删除
function del(url,cid,obj) {
	var obj;
	ajaxpost({
		name:'删除此栏目会删除栏目下的内容!',
		url:url,
		data:{cid:cid},
		tip:true,
		success:function(){
			$(obj).parent().parent().remove();
			window.parent.menu_fram.location='__APP__/menu/content';
		}
	});
}
//栏目排序
function sequence(cid,sid){
	ajaxpost_w({
		url:'__URL__/sequence',
		data:{ cid:cid, sequence:sid },
		tip:1
	});
}
</script>
